<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:70:"/var/www/dangan_new/public/../application/index/view/Manage/index.html";i:1547548510;s:57:"/var/www/dangan_new/application/index/view/top/index.html";i:1547618726;}*/ ?>
<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8"/>
	<title>东海航海保障中心电子档案系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1" name="viewport"/>
	<meta content="" name="description"/>
	<meta content="" name="author"/>
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN PAGE LEVEL PLUGIN STYLES -->
	<link href="/static/assets/plugins/gritter/css/jquery.gritter.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/fullcalendar/fullcalendar/fullcalendar.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/jqvmap/jqvmap/jqvmap.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.css" rel="stylesheet" type="text/css"/>
	<!-- END PAGE LEVEL PLUGIN STYLES -->
	<!-- BEGIN THEME STYLES -->
	<link href="/static/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
	<link href="/static/assets/css/themes/default.css" rel="stylesheet" type="text/css">
	<link href="/static/assets/css/print.css" rel="stylesheet" type="text/css" media="print"/>
	<link href="/static/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico"/>
	<style>
		a:link{text-decoration:none; }  /* 指正常的未被访问过的链接*/

		a:visited{text-decoration:none; }/*指已经访问过的链接*/

		a:hover{text-decoration:none;}/*指鼠标在链接*/}

		a:active{text-decoration:none;}/* 指正在点的链接*/ 
	</style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
<!-- BEGIN HEADER -->
<div class="header navbar navbar-fixed-top">
	<!-- BEGIN TOP NAVIGATION BAR -->
	<div class="header-inner">
		<!-- BEGIN LOGO -->
		<a class="navbar-brand" href="index.html" style="margin-top: -8px;">
			<img src="/static/assets/img/logo.png" alt="logo" class="img-responsive"/ width="30">
		</a>
		<!-- END LOGO -->
		<!-- BEGIN RESPONSIVE MENU TOGGLER -->
		<div class="hor-menu hidden-sm hidden-xs">
			<ul class="nav navbar-nav">
				<!-- <li class="classic-menu-dropdown active">
					<a href="index.html">
						 Dashboard
						<span class="selected">
						</span>
					</a>
				</li> -->
				<li class="mega-menu-dropdown">
					<a href="/" data-hover="dropdown" data-close-others="true" href="" class="dropdown-toggle">
						我的工作台 <!-- <i class="fa fa-angle-down"></i> -->
					</a>

				</li>
				<li>
					<a data-hover="dropdown" data-close-others="true" href="<?php echo url('index/Search/index'); ?>" class="dropdown-toggle">
						档案查询 <!-- <i class="fa fa-angle-down"></i> -->
					</a>
				</li>
				<li class="mega-menu-dropdown mega-menu-full open">
					<a data-hover="dropdown" data-close-others="true" href="<?php echo url('index/Prearc/index'); ?>?cate_id=-1" class="dropdown-toggle">
						档案管理 <!-- <i class="fa fa-angle-down"></i> -->
					</a>
					<ul class="dropdown-menu">
						<li>
						</li>
					</ul>
				</li>
				<li class="mega-menu-dropdown mega-menu-full">
					<a data-hover="dropdown" data-close-others="true" href="<?php echo url('index/Message/index'); ?>?cate_id=-1" class="dropdown-toggle">
						消息管理 <!-- <i class="fa fa-angle-down"></i> -->
					</a>
					<ul class="dropdown-menu">
						<li>
						</li>
					</ul>
				</li>
				<li class="mega-menu-dropdown mega-menu-full">
					<a data-hover="dropdown" data-close-others="true" href="<?php echo url('index/Suggest/index'); ?>" class="dropdown-toggle">
						意见反馈 <!-- <i class="fa fa-angle-down"></i> -->
					</a>
					<ul class="dropdown-menu">
						<li>
						</li>
					</ul>
				</li>
				<!-- <li>
					<span class="hor-menu-search-form-toggler">
						 &nbsp;
					</span>
					<div class="search-form">
						<form class="form-search">
							<div class="input-group">
								<input type="text" placeholder="Search..." class="form-control">
								<div class="input-group-btn">
									<button type="button" class="btn"></button>
								</div>
							</div>
						</form>
					</div>
				</li> -->
			</ul>
		</div>

		<a href="javascript:;" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
			<img src="/static/assets/img/menu-toggler.png" alt=""/>
		</a>
		<!-- END RESPONSIVE MENU TOGGLER -->
		<!-- BEGIN TOP NAVIGATION MENU -->
		
		<ul class="nav navbar-nav pull-right">
			<!-- BEGIN NOTIFICATION DROPDOWN -->
			<li class="dropdown" id="header_notification_bar" style="display: none;">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
					<i class="fa fa-warning"></i>
					<span id="notnum">
						 
					</span>
				</a>
				<ul class="dropdown-menu extended notification">
					<li>
						<p>
							 <span id="noticenum"></span>
						</p>
					</li>
					<!-- <li id="papa"  style="overflow: hidden;max-height: 200px;"> -->
					<li id=""  style="overflow: hidden;max-height: 200px;">
						<!-- <i class="fa fa-bell-o"></i> -->

					<li>
						
					</li>
					<li class="external">
						<a href="<?php echo url('index/Inbox/checknotice'); ?>">
							 查看更多 <i class="m-icon-swapright"></i>
						</a>
					</li>
				</ul>
			</li>
			<!-- END NOTIFICATION DROPDOWN -->
			<!-- BEGIN INBOX DROPDOWN -->
			<li class="dropdown" id="header_inbox_bar">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
					<i class="fa fa-envelope"></i>
					<span id="mailnum" >

					</span>
				</a>
				<ul class="dropdown-menu extended inbox" style="">
					<li>
						<p>
							 <span id="messagenum"></span>

						</p>
					</li>

					<li id="baba"  style="overflow: hidden;max-height: 200px;">
						
					</li>
					<li class="external">
						<a href="<?php echo url('index/Message/index'); ?>">
							 查看更多 <i class="m-icon-swapright"></i>
						</a>
						
					</li>
				</ul>
			</li>
			<script>
				
			</script>
			<!-- END INBOX DROPDOWN -->
			<!-- BEGIN TODO DROPDOWN -->

			<!-- END TODO DROPDOWN -->
			<!-- BEGIN USER LOGIN DROPDOWN -->
			<li class="dropdown user">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
					<!-- <img alt="" src="/static/assets/img/avatar1_small.jpg"/> -->
					<span class="username">
						<?php echo $_SESSION['think']['username'][0]['user_name']; ?>
					</span>
					<i class="fa fa-angle-down"></i>
				</a>
				<ul class="dropdown-menu">
					<li>
						<a href="<?php echo url('index/user/index'); ?>">
							<i class="fa fa-user"></i> 个人中心
						</a>
					</li>
					
					
					<li class="divider">
					</li>
					<li>
						<a href="javascript:;" id="trigger_fullscreen">
							<i class="fa fa-arrows"></i> 全屏
						</a>
					</li>
					
					<li>
						<a href="<?php echo url('index/logout/index'); ?>">
							<i class="fa fa-key"></i> 注销
						</a>
					</li>
				</ul>
			</li>
			<!-- END USER LOGIN DROPDOWN -->
		</ul>

		<!-- END TOP NAVIGATION MENU -->
	</div>
	<!-- END TOP NAVIGATION BAR -->
</div>
<!-- END HEADER -->
<div class="clearfix">
</div>

<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<div class="page-sidebar-wrapper">
		<div class="page-sidebar navbar-collapse collapse">
			<!-- add "navbar-no-scroll" class to disable the scrolling of the sidebar menu -->
			<!-- BEGIN SIDEBAR MENU -->
			<ul class="page-sidebar-menu" data-auto-scroll="true" data-slide-speed="200">
				<li class="sidebar-toggler-wrapper">
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
					<div class="sidebar-toggler hidden-phone">
					</div>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
				</li>
				<!-- {if  $node[0]['menu_name'] == 'level1'}  -->
			
				<li class="prearc">
					<a href="<?php echo url('index/prearc/index'); ?>?cate_id=-1">
						<i class="fa fa-shopping-cart"></i>
						<span class="title">
							立卷
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li>
				<li class="file">
					<a href="<?php echo url('index/file/index'); ?>">
						<i class="fa fa-puzzle-piece"></i>
						<span class="title">
							归档
						</span>
						<span class="arrow ">
						</span>
					</a>

				</li>
				<li class="arc">
					<a href="<?php echo url('index/arc/index'); ?>?cate_id=-2">
						<i class="fa fa-gift"></i>
						<span class="title">
							档案库
						</span>
						<span class="arrow">
						</span>
					</a>
				</li>
					<li class="compilation">
					<a href="<?php echo url('index/compilation/index'); ?>?cate_id=-3">
						<i class="fa fa-bookmark-o"></i>
						<span class="title">
							编研库
						</span>
						<span class="arrow ">
						</span>
					</a>

				</li>
				<li class="storage">
					<a href="<?php echo url('index/storage/index'); ?>">
						<i class="fa fa-cogs"></i>
						<span class="title">
							库房管理
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li>
		
				
				
				
				
				<li class="borrow">
					<!--<a href="javascript:void(0);" onclick="sorry()">-->
					 <a href="<?php echo url('index/borrows/index'); ?>">
						<i class="fa fa-table"></i>
						<span class="title">
							借阅审批
						</span>
						<span class="arrow ">
						</span>
					</a>

				</li>
				
				<li class="destroy">
					<a href="<?php echo url('index/destroy/index'); ?>">
						<i class="fa fa-envelope-o"></i>
						<span class="title">
							鉴定和销毁
						</span>
						<span class="arrow ">
						</span>
					</a>


				</li>
			
				<li class="count">
					<a href="<?php echo url('index/count/index'); ?>">
						<i class="fa fa-bar-chart-o"></i>
						<span class="title">
							统计报表
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li>
				
				<li class="manage">
					<a href="<?php echo url('index/Manage/index'); ?>">
						<i class="fa fa-bar-chart-o"></i>
						<span class="title">
							账户管理
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li>
				
				<!-- <li class="pics">
					<a href="<?php echo url('index/Pics/index'); ?>">
						<i class="fa fa-bar-chart-o"></i>
						<span class="title">
							图片和视频
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li> -->
				
				

				<!-- <li class="power">
					<a href="<?php echo url('index/Power/index'); ?>">
						<i class="fa fa-bar-chart-o"></i>
						<span class="title">
							权限管理
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li> -->
				
				<li class="role">
					<a href="<?php echo url('index/Role/index'); ?>">
						<i class="fa fa-bar-chart-o"></i>
						<span class="title">
							角色权限
						</span>
						<span class="arrow ">
						</span>
					</a>
				</li>
			</ul>
			<!-- END SIDEBAR MENU -->
		</div>
	</div>
	<div class="modal fade" id="model1" tabindex="-1" role="model1" aria-hidden="true" style="display: none;">

		<!-- /.modal-dialog -->
	</div>
	<script src="/static/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
	<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="/static/assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery.cokie.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
	<!-- END CORE PLUGINS -->
	<!-- BEGIN PAGE LEVEL PLUGINS -->
	<script src="/static/assets/plugins/jqvmap/jqvmap/jquery.vmap.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.russia.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.world.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.europe.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.germany.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jqvmap/jqvmap/maps/jquery.vmap.usa.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jqvmap/jqvmap/data/jquery.vmap.sampledata.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/flot/jquery.flot.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/flot/jquery.flot.resize.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/flot/jquery.flot.categories.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery.pulsate.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/bootstrap-daterangepicker/moment.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/bootstrap-daterangepicker/daterangepicker.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/gritter/js/jquery.gritter.js" type="text/javascript"></script>
	<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
	<script src="/static/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
	<script src="/static/assets/plugins/jquery.sparkline.min.js" type="text/javascript"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<!-- <script src="/static/assets/scripts/core/app.js" type="text/javascript"></script> -->
	<!-- <script src="/static/assets/scripts/custom/index.js" type="text/javascript"></script> -->
	<script src="/static/assets/scripts/custom/tasks.js" type="text/javascript"></script>

<!-- END PAGE LEVEL SCRIPTS -->


<script type="text/javascript">
var DDSPEED = 10;
var DDTIMER = 15;
var OFFSET = -2;
var ZINT = 100;
function ddMenu(id,d){
 var h = document.getElementById(id + '-ddheader');
 var c = document.getElementById(id + '-ddcontent');
 clearInterval(c.timer);
 if(d == 1){
  clearTimeout(h.timer);
  c.style.display = 'block';
  if(c.maxh && c.maxh <= c.offsetHeight){return}
  else if(!c.maxh){
   c.style.left = (h.offsetWidth + OFFSET) + 'px';
   c.style.height = 'auto';
   c.maxh = c.offsetHeight;
   c.style.height = '0px';
  }
  ZINT = ZINT + 1;
  c.style.zIndex = ZINT;
  c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
 }else{
  h.timer = setTimeout(function(){ddCollapse(c)},50);
 }
}
function ddCollapse(c){
 c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
}
function cancelHide(id){
 var h = document.getElementById(id + '-ddheader');
 var c = document.getElementById(id + '-ddcontent');
 clearTimeout(h.timer);
 clearInterval(c.timer);
 if(c.offsetHeight < c.maxh){
  c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
 }
}
function ddSlide(c,d){
 var currh = c.offsetHeight;
 var dist;
 if(d == 1){
  dist = Math.round((c.maxh - currh) / DDSPEED);
 }else{
  dist = Math.round(currh / DDSPEED);
 }
 if(dist <= 1 && d == 1){
  dist = 1;
 }
 c.style.height = currh + (dist * d) + 'px';
 c.style.opacity = currh / c.maxh;
 c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
 if(currh > (c.maxh - 2) && d == 1){
  clearInterval(c.timer);
 }else if(dist < 1 && d != 1){
  clearInterval(c.timer);
  c.style.display = 'none';
 }
}
</script>
<!-- END JAVASCRIPTS -->
<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery(document).ready(function() {    
   // App.init(); // initlayout and core plugins
   // Index.init();
   // Index.initJQVMAP(); // init index page's custom scripts
   // Index.initCalendar(); // init index page's custom scripts
   // Index.initCharts(); // init index page's custom scripts
   // Index.initChat();
   // Index.initMiniCharts();
   // Index.initDashboardDaterange();
   // Index.initIntro();
   // Tasks.initDashboardWidget();
});
</script>
<script type="text/javascript">
var DDSPEED = 10;
var DDTIMER = 15;
var OFFSET = -2;
var ZINT = 100;
function ddMenu(id,d){
 var h = document.getElementById(id + '-ddheader');
 var c = document.getElementById(id + '-ddcontent');
 clearInterval(c.timer);
 if(d == 1){
  clearTimeout(h.timer);
  c.style.display = 'block';
  if(c.maxh && c.maxh <= c.offsetHeight){return}
  else if(!c.maxh){
   c.style.left = (h.offsetWidth + OFFSET) + 'px';
   c.style.height = 'auto';
   c.maxh = c.offsetHeight;
   c.style.height = '0px';
  }
  ZINT = ZINT + 1;
  c.style.zIndex = ZINT;
  c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
 }else{
  h.timer = setTimeout(function(){ddCollapse(c)},50);
 }
}
function ddCollapse(c){
 c.timer = setInterval(function(){ddSlide(c,-1)},DDTIMER);
}
function cancelHide(id){
 var h = document.getElementById(id + '-ddheader');
 var c = document.getElementById(id + '-ddcontent');
 clearTimeout(h.timer);
 clearInterval(c.timer);
 if(c.offsetHeight < c.maxh){
  c.timer = setInterval(function(){ddSlide(c,1)},DDTIMER);
 }
}
function ddSlide(c,d){
 var currh = c.offsetHeight;
 var dist;
 if(d == 1){
  dist = Math.round((c.maxh - currh) / DDSPEED);
 }else{
  dist = Math.round(currh / DDSPEED);
 }
 if(dist <= 1 && d == 1){
  dist = 1;
 }
 c.style.height = currh + (dist * d) + 'px';
 c.style.opacity = currh / c.maxh;
 c.style.filter = 'alpha(opacity=' + (currh * 100 / c.maxh) + ')';
 if(currh > (c.maxh - 2) && d == 1){
  clearInterval(c.timer);
 }else if(dist < 1 && d != 1){
  clearInterval(c.timer);
  c.style.display = 'none';
 }
}
</script>
<!-- END JAVASCRIPTS -->

</body>
<!-- END BODY -->
</html>
<script>
	$(function(){
        	setInterval(getNew,60000);
        	// getNew();
    });

        	var id = <?php echo json_encode($_SESSION['think']['username'][0]['user_id']);?>;
        function getNew(){
            $.ajax({
                type:"POST",
                url:"<?php echo url('index/Top/Message'); ?>",
                data:{id:id}, 
                dataType:'json',
                success:function(data){
                	if (data.length == 0) {
                		// 去除class
                		// $('#mailnum').removeClass();
                		$('#messagenum').html('暂无公告');
                	}else{
                		$('#mailnum').addClass('badge');
                		$('#mailnum').html(data.length);
                		$('#messagenum').html('你有'+data.length+'条公告。');
                		$('#baba').empty();
                		for(var i = 0; i <data.length ; i++){
// 
                			$('#baba').append('<a href="<?php echo url("index/inbox/check"); ?>?id='+data[i]['mail_id']+'"><span class="message">'+data[i]['mail_title']+'</span></a>');
                			// $('#baba').css('max-height','200px');
                			// console.log(data[i]['mail_id']);
                			// $('<span>'+$data[i]['mail_title']+'</span>').appendTo('.baba');
                		}
                		
						$(".message").each(function() {
					    if ($(this).text().length > 15) {
					        $(this).html($(this).text().replace(/\s+/g, "").substr(0, 15) + "...")
					    }
					})
                		
                	}

                },
                //Ajax请求超时，继续查询
                error:function(XMLHttpRequest,textStatus,errorThrown){
                   
                }
 
            });
        }
 
    // 
</script>

	<!-- // 查询未读公告 -->
<!-- <script>
	$(function(){
		setInterval(getNotice,5000);
		// getNotice();
    });
        var id = <?php echo json_encode($_SESSION['think']['username'][0]['user_id']);?>;
        function getNotice(){
            $.ajax({
                type:"POST",
                url:"<?php echo url('index/Top/notices'); ?>",
                data:{id:id}, 
                dataType:'json',
                success:function(res){
                	if (res.length == 0 ) {
                		// 去除class
                		// $('#notnum').removeClass();
                		$('#noticenum').html('暂无公告');
                	}else{
                		$('#notnum').addClass('badge');
                		$('#notnum').html(res.length);
                		$('#noticenum').html('你有'+res.length+'条公告。');
                		$('#papa').empty();
                		for(var i = 0; i <res.length ; i++){
// 
                			$('#papa').append('<a href="<?php echo url("index/inbox/check"); ?>?id='+res[i]['mail_id']+'"><span class="notice">'+res[i]['mail_title']+'</span></a>');
                			// console.log(data[i]['mail_id']);
                			// $('<span>'+$data[i]['mail_title']+'</span>').appendTo('.baba');
                		}
                		
						$(".notice").each(function() {
					    if ($(this).text().length > 15) {
					        $(this).html($(this).text().replace(/\s+/g, "").substr(0, 15) + "...")
					    }
					})
                		
                	}

                },
                //Ajax请求超时，继续查询
                error:function(XMLHttpRequest,textStatus,errorThrown){
                   
                }
 
            });
        }
 
</script> -->

<!-- <script>
	$(function(){
		$('.inbox').click(function(){
		$('.inbox').addClass("active");
	});
	});
</script> -->

	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<style>
		.select2-container--open {
 
		 z-index: 9999999 !important;
		 
		}
	</style>
	<div class="page-content-wrapper">
		<div class="page-content" style=" min-height: 700px;">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div class="modal fade" id="portlet-config" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
				<div class="modal-dialog">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
							<h4 class="modal-title">Modal title</h4>
						</div>
						<div class="modal-body">
							 Widget settings form goes here
						</div>
						<div class="modal-footer">
							<button type="button" class="btn blue">Save changes</button>
							<button type="button" class="btn default" data-dismiss="modal">Close</button>
						</div>
					</div>
					<!-- /.modal-content -->
				</div>
				<!-- /.modal-dialog -->
			</div>
			<!-- /.modal -->
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN STYLE CUSTOMIZER -->
			
			<!-- END STYLE CUSTOMIZER -->
			<!-- BEGIN PAGE HEADER-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
					账户管理 <!-- <small>view order details</small> -->
					</h3>
					<ul class="page-breadcrumb breadcrumb">
						
						<li>
							<i class="fa fa-home"></i>
							<a href="<?php echo url('index/index/index'); ?>">
								Home
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
						<li>
							<a href="<?php echo url('index/manage/index'); ?>">
								账户管理
							</a>
							<i class="fa fa-angle-right"></i>
						</li>
						
					</ul>
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- Begin: life time stats -->
					<div class="portlet">
						<div class="portlet-title">
							<div class="caption">
								<i class="fa fa-shopping-cart"></i>账户管理
								<!-- <span class="hidden-480">
									 | Dec 27, 2013 7:16:25
								</span> -->
							</div>
							<!-- <div class="actions">
								<a href="#" class="btn default yellow-stripe">
									<i class="fa fa-angle-left"></i>
									<span class="hidden-480">
										 Back
									</span>
								</a>
								<div class="btn-group">
									<a class="btn default yellow-stripe" href="#" data-toggle="dropdown">
										<i class="fa fa-cog"></i>
										<span class="hidden-480">
											 Tools
										</span>
										<i class="fa fa-angle-down"></i>
									</a>
									<ul class="dropdown-menu pull-right">
										<li>
											<a href="#">
												 Export to Excel
											</a>
										</li>
										<li>
											<a href="#">
												 Export to CSV
											</a>
										</li>
										<li>
											<a href="#">
												 Export to XML
											</a>
										</li>
										<li class="divider">
										</li>
										<li>
											<a href="#">
												 Print Invoice
											</a>
										</li>
									</ul>
								</div>
							</div> -->
						</div>
						<div class="portlet-body">
							<div class="portlet blue box" style="float: left;width: 25%;">
															<div class="portlet-title">
																<div class="caption">
																	<i class="fa fa-cogs"></i>组织架构
																</div>
																<div class="tools">
																	<a href="javascript:;" class="reload">
																	</a>
																</div>
															</div>
															<div class="portlet-body" >
																<div id="tree_1" class="tree-demo" >
																	<?php echo $tree; ?>
																</div>
															</div>
														</div>
								<div class="tab-content">
							<div class="tabbable" style="float: right;width: 70%;">
								<ul class="nav nav-tabs nav-tabs-lg">
									<li class="active">
										<a href="#tab_1" data-toggle="tab">
											 人员
										</a>
									</li>
									<li>
										<a href="#tab_2" data-toggle="tab">
											 部门
											<!-- <span class="badge badge-success">
												 4
											</span> -->
										</a>
									</li>
									
									<li>
										<a href="#tab_3" data-toggle="tab">
											 授权
											<!-- <span class="badge badge-danger">
												 2
											</span> -->
										</a>
									</li>
									
								</ul>
							</div>
														
													<div class="tab-pane active" id="tab_1">
														<div class="table-container" style="float: right;width: 70%;">
															<div  style="float: right;"> 
																<a href="<?php echo url('ryadd'); ?>" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-plus"></i>人员</a>
															</div>
															<table class="table table-striped table-bordered table-hover" id="datatable_shipment">
															<thead>
															<tr role="row" class="heading">
																<th width="15%">
																	 用户名&nbsp;#
																</th>
																<th width="15%">
																	 部门
																</th>
																<th width="30%">
																	 权限
																</th>
																<th width="15%">
																	 操作
																</th>
															</tr>

															<?php if(empty($renyuan)): ?> 
															<tr role="row" class="filter">
																
																<td colspan="4">没有人员信息</td>
															</tr>

															<?php else: if(is_array($renyuan) || $renyuan instanceof \think\Collection || $renyuan instanceof \think\Paginator): $i = 0; $__LIST__ = $renyuan;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$aa): $mod = ($i % 2 );++$i;?>
															<tr role="row" class="filter">
																
																<td>
																	<?php echo $aa['user_name']; ?>
																</td>
																<td>
																	<?php echo $aa['org_name']; ?>
																</td>
																<td>
																	<?php echo $aa['chara_name']; ?>
																</td>
																<td >
																	<a href="<?php echo url('ryedit',['id'=>$aa['user_id']]); ?>" class="btn btn-warning btn">编辑</a>
																	<!-- <a href="<?php echo url('rydel',['id'=>$aa['user_id']]); ?>" class="btn btn-danger btn ">删除</a> -->
																	<?php if($aa['is_delete'] == '0'): ?>
																	<button class="btn btn-danger" data-href="<?php echo url('rydel',['id'=>$aa['user_id']]); ?>" data-toggle="modal" data-target="#confirm-deletery">
																		禁用 
																	</button>
																	<?php else: ?>
																	<button class="btn btn-success" data-href="<?php echo url('ryactive',['id'=>$aa['user_id']]); ?>" data-toggle="modal" data-target="#confirm-active">
																		激活 
																	</button>
																	<?php endif; ?>
																</td>
															</tr>
															<?php endforeach; endif; else: echo "" ;endif; endif; ?>
															</thead>
															</table>
															<div style="float: right;">
															</div>
															<!-- 删除人员的模态框 -->
													<div class="modal fade" id="confirm-deletery" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
													<div class="modal-dialog">
													<div class="modal-content">
													<div class="modal-header">
													请确认
													</div>
													<div class="modal-body">
													确认禁用该人员吗？
													</div>
													<div class="modal-footer">
													<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
													<a class="btn btn-danger btn-okry">禁用人员</a>
													</div>
													</div>
													</div>
													</div>
													
													<script>
														$('#confirm-deletery').on('show.bs.modal', function(e) {
														$(this).find('.btn-okry').attr('href', $(e.relatedTarget).data('href'));
														});
													</script>
												<!--  -->
												<!-- 激活人员的模态框 -->
													<div class="modal fade" id="confirm-active" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
													<div class="modal-dialog">
													<div class="modal-content">
													<div class="modal-header">
													请确认
													</div>
													<div class="modal-body">
													确认激活该人员吗？
													</div>
													<div class="modal-footer">
													<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
													<a class="btn btn-danger btn-active">激活人员</a>
													</div>
													</div>
													</div>
													</div>
													
													<script>
														$('#confirm-active').on('show.bs.modal', function(e) {
														$(this).find('.btn-active').attr('href', $(e.relatedTarget).data('href'));
														});
													</script>
												<!--  -->
														</div>
													</div>
													<div class="tab-pane" id="tab_2">
														<!-- <div class="portlet blue box" style="float: left;width: 25%;">
															<div class="portlet-title">
																<div class="caption">
																	<i class="fa fa-cogs"></i>组织架构
																</div>
																<div class="tools">
																	<a href="javascript:;" class="reload">
																	</a>
																</div>
															</div>
															<div class="portlet-body" >
																<div id="tree_1" class="tree-demo" >
																	<?php echo $tree; ?>
																</div>
															</div>
														</div> -->
														<div class="table-container" style="float: right;width: 70%;">
															<div  style="float: right;"> 
															<a href="<?php echo url('bmadd'); ?>" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-plus"></i>部门</a>
															</div>
															<table class="table table-striped table-bordered table-hover" id="datatable_shipment">
															<thead>
															<tr role="row" class="heading">
																<th width="15%">
																	 类型&nbsp;#
																</th>
																<th width="15%">
																	 部门
																</th>
																<!-- <th width="15%">
																	人数
																</th> -->
																<th width="15%">
																	 操作
																</th>
															</tr>
																</tr role="row" class="filter">
																<?php if(empty($bumen)): ?> 
																<tr role="row" class="filter">
																	
																	<td colspan="4">没有部门信息</td>
																</tr>
																<?php else: if(is_array($bumen) || $bumen instanceof \think\Collection || $bumen instanceof \think\Paginator): $i = 0; $__LIST__ = $bumen;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
																<tr role="row" class="filter">
																	<!-- <td>
																		<input type="checkbox" class="group-checkable" id="<?php echo $vo['org_id']; ?>">
																	</td> -->
																		<?php if(($vo['org_type'] == 0)): ?> <td>中心机关</td>
															            <?php elseif($vo['org_type'] == 1): ?><td>基层单位</td>
															            <?php endif; ?>
																	<td>
																		<a style="text-decoration: none;" href="<?php echo url('sonindex',['id'=>$vo['org_id']]); ?>"><?php echo $vo['org_name']; ?></a>
																	</td>
																
																	<td>
																		<!-- <button class="btn btn-danger btn del-btn" data-id="">编辑</button> -->
																		<a href="<?php echo url('bmedit',['id'=>$vo['org_id']]); ?>" class="btn btn-primary btn">编辑</a>
																		<!-- <a href="<?php echo url('bmdel',['id'=>$vo['org_id']]); ?>" class="btn btn-warning btn">删除</a> -->
																		<button class="btn btn-danger" data-href="<?php echo url('bmdel',['id'=>$vo['org_id']]); ?>" data-toggle="modal" data-target="#confirm-delete">
																		删除部门 
																		</button>
																	</td>
																</tr>
																<?php endforeach; endif; else: echo "" ;endif; endif; ?>
																</div>
								<!-- 删除部门的模态框 -->
									<div class="modal fade" id="confirm-delete" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									<div class="modal-dialog">
									<div class="modal-content">
									<div class="modal-header">
									请确认
									</div>
									<div class="modal-body">
									确认删除该部门吗？
									</div>
									<div class="modal-footer">
									<button type="button" class="btn btn-primary" data-dismiss="modal">取消</button>
									<a class="btn btn-danger btn-ok">删除部门</a>
									</div>
									</div>
									</div>
									</div>
									
									<script>
										$('#confirm-delete').on('show.bs.modal', function(e) {
										$(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href'));
										});
									</script>
								<!--  -->
															</thead>
															<tbody>
															</tbody>
															</table>
														</div>
													</div>
													
													<div class="tab-pane" id="tab_3">
														<!-- <div class="portlet blue box" style="float: left;width: 25%;">
															<div class="portlet-title">
																<div class="caption">
																	<i class="fa fa-cogs"></i>组织架构
																</div>
																<div class="tools">
																	<a href="javascript:;" class="reload">
																	</a>
																</div>
															</div>
															<div class="portlet-body" >
																<div id="tree_1" class="tree-demo" >
																	<?php echo $tree; ?>
																</div>
															</div>
														</div> -->
														<div class="table-container" style="float: right;width: 70%;">
															<button class="btn btn-success btn-sm " data-toggle="modal" data-target="#myModal" style="float: right;">
																<i class="glyphicon glyphicon-plus"></i>授权
															</button>
															<table class="table table-striped table-bordered table-hover" id="datatable_shipment">
															<thead>
															<tr role="row" class="heading">
																<th width="20%">
																	 权限&nbsp;#
																</th>
																<th width="80%">
																	 人员
																</th>
																
																<?php if(is_array($all) || $all instanceof \think\Collection || $all instanceof \think\Paginator): $i = 0; $__LIST__ = $all;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?>
																<tr role="row" class="filter">
																	<td><?php echo $vo['chara_name']; ?></td>
																	<td><?php echo $vo['user_name']; ?></td>
																<?php endforeach; endif; else: echo "" ;endif; ?>
																</tr>
															</thead>
															<tbody>
															</tbody>
															</table>
															<!-- 模态框（Modal） -->
															<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
																<div class="modal-dialog">
																	<div class="modal-content">
																		<div class="modal-header">
																			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
																				&times;
																			</button>
																			<h4 class="modal-title" id="myModalLabel">
																				授权
																			</h4>
																		</div>
																		
																		<div class="modal-body">
																			<div class="form-group">
																			<label class="col-sm-2 control-label">人员:</label>
																			    <select id="use" style="width: 400px;" multiple="multiple" class="form-control-static col-sm-10">
																			        <?php if(is_array($use) || $use instanceof \think\Collection || $use instanceof \think\Paginator): $i = 0; $__LIST__ = $use;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$user): $mod = ($i % 2 );++$i;?>
																						<option> <?php echo $user; ?></option>
																					<?php endforeach; endif; else: echo "" ;endif; ?>

																			    </select>
																			</div>

																			<div class="form-group">
																			    <label class="col-sm-2 control-label">权限:</label>
																				   <!-- <select class="form-control-static col-sm-10" name="cha" id="cha"> -->
																					<?php if(is_array($cha) || $cha instanceof \think\Collection || $cha instanceof \think\Paginator): $i = 0; $__LIST__ = $cha;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$char): $mod = ($i % 2 );++$i;?>
																					<div style="float: left;">
																					<input type="checkbox" name="cha" id="cha" value="<?php echo $char['chara_id']; ?>"><?php echo $char['chara_name']; ?>
																					</div>
																					<?php endforeach; endif; else: echo "" ;endif; ?>
																					<!-- </select> -->
																			</div>
																			<br>
																		</div>
																		<div class="modal-footer">
																			<button type="button" class="btn btn-warning close-btn" data-dismiss="modal">关闭
																			</button>
																				<input type="submit" class="btn btn-primary sub-btn" value="授权"/>
																		</div>
																	</div><!-- /.modal-content -->
																</div><!-- /.modal -->
														</div>
													</div>
													
												</div>
											</div>
										</div>
									</div>
									<!-- End: life time stats -->
								</div>
							</div>
							<!-- END PAGE CONTENT-->
						</div>
					</div>
					<!-- END CONTENT -->
				</div>
				<!-- END CONTAINER -->
				<!-- BEGIN FOOTER -->
				<div class="footer">
					<div class="footer-inner">
						 2018 &copy; 仁聚科技
					</div>
					<div class="footer-tools">
						<span class="go-top">
							<i class="fa fa-angle-up"></i>
						</span>
					</div>
				</div>
				<!-- END FOOTER -->
				<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
				<!-- BEGIN CORE PLUGINS -->
				<!--[if lt IE 9]>
    <script src="assets/plugins/respond.min.js"></script>
    <script src="assets/plugins/excanvas.min.js"></script> 
    <![endif]-->
				<script src="/static/assets/plugins/jstree/dist/jstree.min.js"></script>
				<script src="/static/assets/scripts/custom/ui-tree.js"></script>
				<script src="/static/assets/scripts/core/app.js"></script>
				<link rel="stylesheet" type="text/css" href="/static/assets/plugins/jstree/dist/themes/default/style.min.css"/>
				<script src="/static/assets/scripts/core/dt.js"></script>
				<script src="/static/assets/js/toastr.min.js" rel="stylesheet"/></script>
				<link href="/static/assets/css/toastr.min.css" rel="stylesheet"/>
				<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet" />
				<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
				<!-- END PAGE LEVEL SCRIPTS -->
<script type="text/javascript">

    $(document).ready(function() {
        $("#use").select2();
    });


</script>

	
<script>
    dt().getModals();
    dt().getUrl();
    
    jQuery(document).ready(function() {
        App.init();
        UITree.init();
        var url = '<?php echo url('index/Manage/index'); ?>';
        
        $("#tree_1").on('changed.jstree', function (e, data) {
            var id = data.node.data.id;
            // console.log(id);
            $.ajax({
                url:'<?php echo url('index/common/setOrg_Id'); ?>',
                data:{org_id:id},
                type:'post',
                dataType:'json',
                success:function (c) {
                    // if(e.code ==1) {
                    //     window.location.href = url;
                    // }
                    
                }
            });
        });

        $("#tree_1").on('changed.jstree', function (e, data) {
            var id = data.node.data.id;
            // console.log(id);
            $.ajax({
                url:'<?php echo url('index/manage/treeindex'); ?>',
                data:{id:id},
                type:'post',
                // dataType:'json',
                success:function (e) {
                    // if(e.code ==1) {
					window.location.href = "/index/manage/sonindex/id/"+id+".html";
                        // window.location.href = url;
                    // }
                    
                }
            });
        });
    });
</script>
    <script type="text/javascript">
  // 获取cha use的值
  $(function(){
    	 var checkID = [];//定义一个空数组
    $('.sub-btn').click(function () {
         $("input[name='cha']:checked").each(function(i){ //把所有被选中的复选框的值存入数组
             checkID[i] =$(this).val();
          });
      	postdata();
    });

     function postdata(){     
         //提交数据函数   
        toastr.options = {  
            closeButton: true,  
            debug: false,  
            progressBar: true,  
            positionClass: "toast-top-right",  
            onclick: null,  
            showDuration: "1000",  
            hideDuration: "1000",  
            timeOut: "1000",  
            extendedTimeOut: "1000",  
            showEasing: "swing",  
            hideEasing: "linear",  
            showMethod: "fadeIn",  
            hideMethod: "fadeOut"  
        };

        $.ajax({                                                  //调用jquery的ajax方法   
          type: "POST",                                      //设置ajax方法提交数据的形式   
          url: "sqzz",                                        
          data: {
                  cha : checkID,
                  use : $("#use").val()
              }, 
          success: function(data){    
          // console.log(data);   
          if (data) {
            toastr.success('授权成功');
            setInterval(function(){
              location.reload(true);
            }, 1000);
          }else{
            toastr.error('授权失败，请重试');
          }
        },
        error: function () {
                alert('AJAX操作失败');
            }
        });   
     }   
    })
</script>
<script>
		$(function(){
			$('.manage').addClass("active");
		});
</script>
				<!-- END JAVASCRIPTS -->
</body>
				<!-- END BODY -->
</html>

<!-- 查询未读邮件 -->
